/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');

exports.HSZStatus = {
    'NONE': 0,
    'FINISHED': 1,
}

var ScoreRule = clone(MJ.ScoreRule);

var Pattern = {
    'NONE': 0,                // 不是可胡的牌型
    'NORMAL': 1,              // 平胡
    'PAIR': 2,                // 大对
    'PAIR7': 3,               // 七对
    'SINGLE': 4,              // 单调

    'NORMAL_DGUI': 11,       // 带归胡
    'NORMAL_SGUI': 12,       // 手归胡
    'NORMAL_COLOR': 15,      // 清一色
    'NORMAL_COLOR_DGUI': 16,// 清带归
    'NORMAL_COLOR_SGUI': 17,// 清手归

    'PAIR_COLOR': 25,        // 清大对

    'PAIR7_LONG': 32,       // 龙七对
    'PAIR7_COLOR': 35,      // 清七对
    'PAIR7_COLOR_LONG': 37,// 清龙对

    'SINGLE_COLOR': 45,     // 清单调
};

var PatternScore = {}
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.PAIR] = 4;
PatternScore[Pattern.PAIR7] = 6;
PatternScore[Pattern.SINGLE] = 10;

PatternScore[Pattern.NORMAL_DGUI] = 4;
PatternScore[Pattern.NORMAL_SGUI] = 6;
PatternScore[Pattern.NORMAL_COLOR] = 6;
PatternScore[Pattern.NORMAL_COLOR_DGUI] = 10;
PatternScore[Pattern.NORMAL_COLOR_SGUI] = 12;
PatternScore[Pattern.PAIR_COLOR] = 10;
PatternScore[Pattern.PAIR7_LONG] = 10;
PatternScore[Pattern.PAIR7_COLOR] = 12;
PatternScore[Pattern.PAIR7_COLOR_LONG] = 16;
PatternScore[Pattern.SINGLE_COLOR] = 16;

var ItemScore = {};
ItemScore[ScoreRule.ZM] = 1;
ItemScore[ScoreRule.GSH] = 4;
ItemScore[ScoreRule.GSP] = 4;
ItemScore[ScoreRule.QG] = 4;
ItemScore[ScoreRule.BT] = 6;
ItemScore[ScoreRule.TH] = 10;
ItemScore[ScoreRule.DIHU] = 10;


var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸
    PT: 10,             // 陪听/查叫

    BT: MJ.ScoreRule.BT, // 陪报听/查报听
};

var GangScore = {};
GangScore[MJ.Gang.BA] = 1;
GangScore[MJ.Gang.AN] = 3;
GangScore[MJ.Gang.DIAN] = 2;
GangScore[MJ.Gang.ANS] = 3;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;